<!--继承base.html的基础模板-->
{% extends "back/base.html" %}

<!--新增的样式-->
{% block style %}
{% endblock %}

<!--主要内容-->
{% block body %}
<div class="container-fluid">
    <!-- 个人资料 -->
    <div class="body teacher-profile">
        <div class="profile" style="padding-top:100px">
            <div class="row c1">
                <div class="col-md-6">
                    <div id="sowingCount" class="cell s1">
                        
                    </div>
                </div>
                <div class="col-md-6">
                    <div id="sourceCount" class="cell s2">
                    </div>
                </div>
            </div>
            
        </div>
    </div>
</div>
{% endblock %}

<!--脚本-->
{% block script %}
<script>

    //请求所有轮播图数目
    $.get({
            url:"http://localhost:3000/back/sowing/api/list",
            success:(res)=>{
                let html_t = '';
                if(res.status === 200){
                    html_t = `
                        <i class="fa fa-users"></i>
                        <h4>轮播图数目</h4>
                        <h5>${res.result.length}</h5>
                    `
                }
                $("#sowingCount").html(html_t)
            }
        })

    //请求文章资源数目
    $.get({
            url:"http://localhost:3000/web/source/api/count",
            success:(res)=>{
                let html_t = '';
                if(res.status === 200){
                    html_t = `
                        <i class="fa fa-users"></i>
                        <h4>文章资源数目</h4>
                        <h5>${res.result}</h5>
                    `
                }
                $("#sourceCount").html(html_t)
            }
        })
</script>
{% endblock %}
